import request from '@/utils/request'

// 查询业务分类列表
export function listBusiness(query) {
  return request({
    url: '/system/business/list',
    method: 'get',
    params: query
  })
}

// 查询业务分类列表
export function businessList(query) {
  return request({
    url: '/system/business/businessList',
    method: 'get',
    params: query
  })
}

// 查询业务分类详细
export function getBusiness(businessId) {
  return request({
    url: '/system/business/' + businessId,
    method: 'get'
  })
}

// 新增业务分类
export function addBusiness(data) {
  return request({
    url: '/system/business',
    method: 'post',
    data: data
  })
}

// 修改业务分类
export function updateBusiness(data) {
  return request({
    url: '/system/business',
    method: 'put',
    data: data
  })
}

// 删除业务分类
export function delBusiness(businessId) {
  return request({
    url: '/system/business/' + businessId,
    method: 'delete'
  })
}

// 发起评估
export function initiateEvaluate(data) {
  return request({
    url: '/system/business/initiateEvaluate',
    method: 'post',
    data: data
  })
}

// 获取部门树列表
export function businessTree(query) {
  return request({
    url: '/system/business/businessTree',
    method: 'get',
    params: query
  })
}

// 获取部门树列表
export function businessControlTree(query) {
  return request({
    url: '/system/business/businessControlTree',
    method: 'get',
    params: query
  })
}

// 查询业务分类列表
export function businessIndexList(query) {
  return request({
    url: '/system/business/businessIndexList',
    method: 'get',
    params: query
  })
}

export function businessCountByType(type) {
  return request({
    url: '/system/business/businessCountByType',
    method: 'get',
    params: {
      type: type
    }
  })
}

export function businessCountByLevel() {
  return request({
    url: '/system/business/businessCountByLevel',
    method: 'get'
  })
}

export function businessTotalCount() {
  return request({
    url: '/system/business/businessTotalCount',
    method: 'get'
  })
}

export function businessCountByDept() {
  return request({
    url: '/system/business/businessCountByDept',
    method: 'get'
  })
}

export function exportProcess(data) {
  return request({
    url: '/system/business/exportProcess',
    method: 'post',
    data: data
  })
}

